<?php
/** Defines key codes that is used in dzevent.
 *
 *  This code is licensed under GPL2.
 *  See LICENSE or www.gnu.org for more details.
 *
 *  @author Jyry Kuukkanen
 *  $Id: dzkeycodes.php 595 2006-04-03 16:00:47Z jyry $
 */

include_once("sonetwork.php");


/***************************** Netscape key codes *****************************/
$DZ_KEY_CODES_NS4 = array(
                    "f1" => "64270",
                    "f2" => "64271",
                    "f3" => "64272",
                    "f4" => "64273",
                    "f5" => "64274",
                    "f6" => "64275",
                    "f7" => "64276",
                    "f8" => "64277",
                    "f9" => "64278",
                    "f10" => "64279",
                    "f11" => "64280",
                    "f12" => "64281",

/* Control key combinations */

                    "c-up" => "2+65362",
                    "c-down" => "2+65364",
                    "c-left" => "2+65363",
                    "c-right" => "2+65361",

                    "c-pgup" => "2+65365",
                    "c-pgdw" => "2+65366",
                    "c-home" => "2+65360",
                    "c-end" => "2+65367",

                    "c-bs" => "2+8",
                    "c-enter" => "2+65293",
                    "c-del" => "2+65535",
                    "c-ins" => "2+65379",
                    "c-f1" => "2+64270",
                    "c-f2" => "2+64271",
                    "c-f3" => "2+64272",
                    "c-f4" => "2+64273",
                    "c-f5" => "2+64274",
                    "c-f6" => "2+64275",
                    "c-f7" => "2+64276",
                    "c-f8" => "2+64277",
                    "c-f9" => "2+64278",
                    "c-f10" => "2+64279",
                    "c-f11" => "2+64280",
                    "c-f12" => "2+64281",
                    "c-a" => "2+97",
                    "c-b" => "2+98",
                    "c-c" => "2+99",
                    "c-d" => "2+100",
                    "c-e" => "2+101",
                    "c-f" => "2+102",
                    "c-g" => "2+103",
                    "c-h" => "2+104",
                    "c-i" => "2+105",
                    "c-j" => "2+106",
                    "c-k" => "2+107",
                    "c-l" => "2+108",
                    "c-m" => "2+109",
                    "c-n" => "2+110",
                    "c-o" => "2+111",
                    "c-p" => "2+112",
                    "c-q" => "2+113",
                    "c-r" => "2+114",
                    "c-s" => "2+115",
                    "c-t" => "2+116",
                    "c-u" => "2+117",
                    "c-v" => "2+118",
                    "c-w" => "2+119",
                    "c-x" => "2+120",
                    "c-y" => "2+121",
                    "c-z" => "2+122",

                    "c-0" => "2+48",
                    "c-1" => "2+49",
                    "c-2" => "2+50",
                    "c-3" => "2+51",
                    "c-4" => "2+52",
                    "c-5" => "2+53",
                    "c-6" => "2+54",
                    "c-7" => "2+55",
                    "c-8" => "2+56",
                    "c-9" => "2+57",

/* Meta key combinations (alt gr, win, win menu) */

                    "m-up" => "1+65362",
                    "m-down" => "1+65364",
                    "m-left" => "1+65363",
                    "m-right" => "1+65361",

                    "m-pgup" => "1+65365",
                    "m-pgdw" => "1+65366",
                    "m-home" => "1+65360",
                    "m-end" => "1+65367",

                    "m-enter" => "1+65293",
                    "m-del" => "1+65535",
                    "m-ins" => "1+65379",
                    "m-f1" => "1+64270",
                    "m-f2" => "1+64271",
                    "m-f3" => "1+64272",
                    "m-f4" => "1+64273",
                    "m-f5" => "1+64274",
                    "m-f6" => "1+64275",
                    "m-f7" => "1+64276",
                    "m-f8" => "1+64277",
                    "m-f9" => "1+64278",
                    "m-f10" => "1+64279",
                    "m-f11" => "1+64280",
                    "m-f12" => "1+64281",
                    "m-a" => "1+97",
                    "m-b" => "1+98",
                    "m-c" => "1+99",
                    "m-d" => "1+100",
                    "m-e" => "1+101",
                    "m-f" => "1+102",
                    "m-g" => "1+103",
                    "m-h" => "1+104",
                    "m-i" => "1+105",
                    "m-j" => "1+106",
                    "m-k" => "1+107",
                    "m-l" => "1+108",
                    "m-m" => "1+109",
                    "m-n" => "1+110",
                    "m-o" => "1+111",
                    "m-p" => "1+112",
                    "m-q" => "1+113",
                    "m-r" => "1+114",
                    "m-s" => "1+115",
                    "m-t" => "1+116",
                    "m-u" => "1+117",
                    "m-v" => "1+118",
                    "m-w" => "1+119",
                    "m-x" => "1+120",
                    "m-y" => "1+121",
                    "m-z" => "1+122",

                    "m-0" => "1+48",
                    "m-1" => "1+49",
                    "m-2" => "1+50",
                    "m-3" => "1+51",
                    "m-4" => "1+52",
                    "m-5" => "1+53",
                    "m-6" => "1+54",
                    "m-7" => "1+55",
                    "m-8" => "1+56",
                    "m-9" => "1+57",

                    );


/***************************** Mozilla key codes *****************************/
$DZ_KEY_CODES_MOZ5 = array(
                    "f1" => "64270",
                    "f2" => "64271",
                    "f3" => "64272",
                    "f4" => "64273",
                    "f5" => "64274",
                    "f6" => "64275",
                    "f7" => "64276",
                    "f8" => "64277",
                    "f9" => "64278",
                    "f10" => "64279",
                    "f11" => "64280",
                    "f12" => "64281",

/* Control key combinations */

                    "c-up" => "2+65362",
                    "c-down" => "2+65364",
                    "c-left" => "2+65363",
                    "c-right" => "2+65361",

                    "c-pgup" => "2+65365",
                    "c-pgdw" => "2+65366",
                    "c-home" => "2+65360",
                    "c-end" => "2+65367",

                    "c-bs" => "2+8",
                    "c-enter" => "2+65293",
                    "c-del" => "2+46",
                    "c-ins" => "2+45",
                    "c-f1" => "2+64270",
                    "c-f2" => "2+64271",
                    "c-f3" => "2+64272",
                    "c-f4" => "2+64273",
                    "c-f5" => "2+64274",
                    "c-f6" => "2+64275",
                    "c-f7" => "2+64276",
                    "c-f8" => "2+64277",
                    "c-f9" => "2+64278",
                    "c-f10" => "2+64279",
                    "c-f11" => "2+64280",
                    "c-f12" => "2+64281",
                    "c-a" => "2+97",
                    "c-b" => "2+98",
                    "c-c" => "2+99",
                    "c-d" => "2+100",
                    "c-e" => "2+101",
                    "c-f" => "2+102",
                    "c-g" => "2+103",
                    "c-h" => "2+104",
                    "c-i" => "2+105",
                    "c-j" => "2+106",
                    "c-k" => "2+107",
                    "c-l" => "2+108",
                    "c-m" => "2+109",
                    "c-n" => "2+110",
                    "c-o" => "2+111",
                    "c-p" => "2+112",
                    "c-q" => "2+113",
                    "c-r" => "2+114",
                    "c-s" => "2+115",
                    "c-t" => "2+116",
                    "c-u" => "2+117",
                    "c-v" => "2+118",
                    "c-w" => "2+119",
                    "c-x" => "2+120",
                    "c-y" => "2+121",
                    "c-z" => "2+122",

                    "c-0" => "2+48",
                    "c-1" => "2+49",
                    "c-2" => "2+50",
                    "c-3" => "2+51",
                    "c-4" => "2+52",
                    "c-5" => "2+53",
                    "c-6" => "2+54",
                    "c-7" => "2+55",
                    "c-8" => "2+56",
                    "c-9" => "2+57",

/* Meta key combinations (alt gr, win, win menu) */

                    "m-up" => "1+65362",
                    "m-down" => "1+65364",
                    "m-left" => "1+65363",
                    "m-right" => "1+65361",

                    "m-pgup" => "1+65365",
                    "m-pgdw" => "1+65366",
                    "m-home" => "1+65360",
                    "m-end" => "1+65367",

                    "m-enter" => "1+65293",
                    "m-del" => "1+65535",
                    "m-ins" => "1+65379",
                    "m-f1" => "1+64270",
                    "m-f2" => "1+64271",
                    "m-f3" => "1+64272",
                    "m-f4" => "1+64273",
                    "m-f5" => "1+64274",
                    "m-f6" => "1+64275",
                    "m-f7" => "1+64276",
                    "m-f8" => "1+64277",
                    "m-f9" => "1+64278",
                    "m-f10" => "1+64279",
                    "m-f11" => "1+64280",
                    "m-f12" => "1+64281",
                    "m-a" => "1+97",
                    "m-b" => "1+98",
                    "m-c" => "1+99",
                    "m-d" => "1+100",
                    "m-e" => "1+101",
                    "m-f" => "1+102",
                    "m-g" => "1+103",
                    "m-h" => "1+104",
                    "m-i" => "1+105",
                    "m-j" => "1+106",
                    "m-k" => "1+107",
                    "m-l" => "1+108",
                    "m-m" => "1+109",
                    "m-n" => "1+110",
                    "m-o" => "1+111",
                    "m-p" => "1+112",
                    "m-q" => "1+113",
                    "m-r" => "1+114",
                    "m-s" => "1+115",
                    "m-t" => "1+116",
                    "m-u" => "1+117",
                    "m-v" => "1+118",
                    "m-w" => "1+119",
                    "m-x" => "1+120",
                    "m-y" => "1+121",
                    "m-z" => "1+122",

                    "m-0" => "1+48",
                    "m-1" => "1+49",
                    "m-2" => "1+50",
                    "m-3" => "1+51",
                    "m-4" => "1+52",
                    "m-5" => "1+53",
                    "m-6" => "1+54",
                    "m-7" => "1+55",
                    "m-8" => "1+56",
                    "m-9" => "1+57",
                    );

/* Find out the used browser and use the appropriate key map */
$browser = soGetBrowser().soGetBrowserVersion();

/* Depending on the user's browser chooce the key map */
switch ($browser) {
    case "mozilla5":
        $_DZ_GLOBALS[DZGV_KEYCODES] = $DZ_KEY_CODES_MOZ5;
        break;
    default:
        $_DZ_GLOBALS[DZGV_KEYCODES] = $DZ_KEY_CODES_NS4;
} // switch

?>
